<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class Mypromise{
            constructor(handle){
                // 默认属性 
                this[['PromiseState']] = 'pending';
                tihs[['PromiseRuselt']] = undefined;


                handle(this._resolve.bind(this),this._reject.bind(this));
            }
            _resolve(val){
                this[['PromiseState']] = 'fulfilled';
                tihs[['PromiseRuselt']] = val;
            }
            _reject(err){
                this[['PromiseState']] = 'rejected';
                tihs[['PromiseRuselt']] = err; 
            }
        }



        let p = new Mypromise((resolve,reject)=>{
            // resolve(222);
            reject(212);
        })


    </script>
</body>
</html>